home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / amiga / opalvisn / lsidocs.lha / LoaderSaver.doc < prev    next >
Encoding:
Text File  |  1993-07-27  |  25.9 KB  |  630 lines

  1.  
  2.           Loader Saver documentation (Draft)
  3.  
  4.  
  5.             INTRODUCTION
  6.  
  7. OpalPaint's  Loader  and  Saver modules are implemented in a different manor
  8. than  the  Drawing Mode, Artist Tool, and Paper Type modules.  Communication
  9. between  the  Loader Saver modules and OpalPaint is handled exlusively using
  10. Exec  Messages.   This interlace will be known as the Loader Saver Interface
  11. (LSI).
  12.  
  13. This  interface has been designed to decouple as much as possible the loader
  14. or  saver  program  from  OpalPaint  itself,  by  doing  this  the module is
  15. available  for  use  by  not  only  OpalPaint  but  any  other program which
  16. understands  the  message  passing  format.   This includes the Opal.Library
  17. which  provides  alot  of  compatibility.   As  every  other  program except
  18. OpalPaint  uses  the  library's load and save functions this gives automatic
  19. compatibility  with OpalHotKey, MakeAnim24, OpalPresents!, Show24 and the PD
  20. programs which are now starting to appear.
  21.  
  22. As  the  interface is purely a transparent way of passing Image data between
  23. the  two  programs  the LSI can be used for many different types of modules,
  24. for  example a module to print the current image could be written as a saver
  25. module  and  a  module  to  scan  an  image from a flat bed scanner could be
  26. written as a loader module.
  27.  
  28. The  opal.library  is  used  as  the  clearing house for the LSI modules.  A
  29. module  must  make  itself  available  for  use  by  calling an opal.library
  30. function to have itself added to the current list of modules.  Likewise when
  31. an  application  such  as  OpalPaint wishes to perform a save or load it can
  32. call  an  opal.library  function  to  get  the  currently  available list of
  33. modules.
  34.  
  35. For  a  particular  file  format, a seperate loader and saver module must be
  36. written, or alternatively only one of these can be implemented.
  37.  
  38.  
  39.             INITIALISING LSI MODULES
  40.  
  41. The LSIModules must reside in the correct directories, that is:
  42.  
  43.     OpalPaint:Savers     - For Saver modules.
  44.     OpalPaint:Loaders    - For Loader modules.
  45.  
  46. also, the modules must have the correct file name extensions, that is:
  47.  
  48.     .saver            - For Saver modules.
  49.     .loader            - For Loader modules.
  50.  
  51. The  modules  are  initialised  into the system by executing the InstallLSI
  52. command,  this command scans through the above directories and executes all
  53. the  programs  with the correct extensions.  This command would normally be
  54. executed  in  the  s:user-startup or via the WBStartup.  The InstallLSI and
  55. RemoveLSI  programs  accept  a  'verbose'  parameter which will display all
  56. modules installed and removed from the system.
  57.  
  58.  
  59.  
  60.              THE LOADER SAVER INTERFACE
  61.  
  62. The  application  performing  the  save  or  load  will  be  called the host
  63. application.   The  communication between the host and LSI module is handled
  64. using Exec messages, the actual message structure is called an LSIMessage an
  65. has the following format:
  66.  
  67.  
  68. struct LSIMessage
  69.     { struct Message lsi_Node;    /* Standard Message Node    */
  70.       ULONG lsi_Type;        /* Command Type            */
  71.       ULONG lsi_SubType;        /* Command SubType        */
  72.       ULONG lsi_Flags;        /* General Flags        */
  73.       SHORT lsi_X;            /* Horizontal pixel offset    */
  74.       SHORT lsi_Y;            /* Vertical pixel offset    */
  75.       SHORT lsi_Width;        /* Image Width            */
  76.       SHORT lsi_Height;        /* Image Height            */
  77.       SHORT lsi_Depth;        /* Image Depth            */
  78.       SHORT lsi_Resolution;        /* Opal image resolution flags    */
  79.       UBYTE *lsi_Planes[24];    /* BitPlane pointers        */
  80.       ULONG lsi_Result;        /* Command Result        */
  81.       BPTR    lsi_File;        /* File handle            */
  82.       char    *lsi_FileName;        /* File name being loaded    */
  83.       struct OpalScreen *lsi_OScrn;    /* OpalScreen as Source or Dest */
  84.       LONG    lsi_DataLength;        /* Misc data length        */
  85.       APTR    lsi_Address;        /* Misc pointer         */
  86.     };
  87.  
  88.    lsi_Node
  89.     This is a standard Exec message.
  90.  
  91.    lsi_Type
  92.     This field defines the type of command to be performed, this command
  93.     could be from the host to the module or module to host. Typical
  94.     commands form the host would be 'Save Image','load Image','Check file
  95.     format' and typical commands from the module to the host would be
  96.     'Get Image Data', 'Set Palette'.
  97.  
  98.    lsi_SubType
  99.     This field is used as a qualifier to the Type command. This is currently
  100.     only used for the OVCMD_GETDATA and OVCMD_SENDDATA commands to specify
  101.     the data format of image data being passed (for example BitPlanes,
  102.     RGB or interleaved bitmap).
  103.  
  104.    lsi_Flags
  105.     This is a set of flags which are specific to the current command
  106.     (lsi_Type) being performed.
  107.  
  108.    lsi_X, lsi_Y
  109.     This is used to specify the destination or source pixel location for
  110.     image data in the OVCMD_GETDATA and OVCMD_SENDDATA. Note that for
  111.     some data formats the 'X' location will not be valid.
  112.  
  113.    lsi_Width,lsi_Height
  114.     This is used to specify the rectangular section of image data for
  115.     the OVCMD_GETDATA and OVCMD_SENDDATA.
  116.  
  117.     These fields will also give the size of the image in the OVCMD_SAVEIMAGE
  118.     command or should be set to the image size for the OVCMD_FORMATCHECK
  119.     command.
  120.  
  121.    lsi_Depth
  122.     This field will contain the depth of the image in the OVCMD_SAVEIMAGE
  123.     command or should be set to the image depth for the OVCMD_FORMATCHECK
  124.     command.
  125.  
  126.    lsi_Resolution
  127.     This field will contain the resolution of the image as defined in
  128.     opallib.h (i.e HIRES24, ILACE24 etc). This will be valid in the
  129.     OVCMD_SAVEIMAGE field or should be set to the image depth for the
  130.     OVCMD_FORMATCHECK command.
  131.  
  132.    lsi_Planes
  133.     This array will contain pointers to either an initialised source
  134.     image buffer for the OVCMD_SENDDATA command or empty buffers large
  135.     enough to hold the image data for the OVCMD_GETDATA command. The
  136.     number of pointers that need to be initialised will vary depending
  137.     on the format of the image data.
  138.  
  139.    lsi_Result
  140.     This field will hold the return values of commands when appropriate.
  141.  
  142.    lsi_file
  143.     This field will hold the Dos filehandle for the image being loaded
  144.     this is only valid for loads. When performing a save you must
  145.     open the file named by lsi_FileName.
  146.  
  147.    lsi_FileName
  148.     This is the full filename (including path) of the image being
  149.     saved or loaded.
  150.  
  151.    lsi_OScrn
  152.     This is a pointer to the OpalScreen structure describing the
  153.     image that is being saved. Only use this structure if absolutely
  154.     necessary.
  155.  
  156.    lsi_Address
  157.     This is a general purpose pointer which is used by some commands.
  158.  
  159.    lsi_DataLength
  160.     When lsi_Address is used as a pointer to an array or buffer, this
  161.     field contains the length of the buffer itself.
  162.  
  163.  
  164. To  issue  a  command  to  the  host, it requires a standard PutMsg(),
  165. WaitPort(), GetMsg() sequence. To simplify this the LSICmd() macro
  166. defined in LoadSave.h can be used. The format is:
  167.  
  168.    LSICmd (struct MsgPort *HostPort, struct MsgPort *ModulePort,
  169.          struct LSIMessage *Command)
  170.  
  171.  
  172.  
  173.             SAVER MODULES
  174.  
  175. When  a  Saver module initialises itself it must create a message port
  176. which  will  be used to communicate with the host program.  The naming
  177. convention  for  this  port will include a brief name of the format or
  178. purpose  of  the  module suffixed with "_Saver" some examples would be
  179. "Tiff_Saver", "Epson123_Saver".
  180.  
  181. Once  this  message port has been created you must add yourself to the
  182. current  list  of  active  saver modules, to do this you must open the
  183. opal.library and issue the following command:
  184.  
  185.     AddOVSaver (SaverName,SaverPort,Flags)
  186.  
  187. 'SaverName' will normally be the portname without the "_Saver" suffix.
  188. This  name  will  be used to identify the saver both internally within
  189. applications  and  also  to  the user in programs like OpalPaint which
  190. give a list of the currently available saver modules.
  191.  
  192. 'SaverPort' is a pointer to the message port created earlier.
  193.  
  194. 'Flags' include the following flags:
  195.  
  196.    OVSF_ALLOWIMAGE
  197.     Module is capable of saving the image data.
  198.  
  199.    OVSF_ALLOWSTENCIL
  200.     Module is capable of saving a 1 bitplane stencil.
  201.  
  202.    OVSF_ALLOWALPHA
  203.     Module is capable of saving 8bit alpha channel data.
  204.  
  205.    OVSF_NEEDFILENAME
  206.     Module requires a filename to perform the save. This is useful
  207.     for modules such as printer output which do not require a
  208.     filename and hence the user will not see a filerequester in
  209.     OpalPaint.
  210.  
  211.  
  212. Once  the module has been added to the system, it should then wait for
  213. messages  to  arrive  at  it's message port.  When an external program
  214. attempts  to  perform  a  save  using  your  module you will receive a
  215. OVCMD_SAVEIMAGE  LSIMessage  at  your port.  This message will contain
  216. the  size  of  the  image  in  pixels in lsi_Width and lsi_Height, the
  217. bitplane  depth  of the image in lsi_Depth as well as the filename for
  218. the  resulting  file in lsi_FileName (if the OVSF_NEEDFILENAME flag is
  219. set for that module).  The image components that need to be saved will
  220. be defined by lsi_Flags, these flags are LSIF_IMAGEDATA,LSIF_ALPHA and
  221. LSIF_STENCIL.
  222.  
  223. Note,  before  you  wait for messages at your message port, you should
  224. close  opal.library  if  you  fail  to  do  so,  the library cannot be
  225. expunged from memory.
  226.  
  227. While  your module is inactive, one of 3 possible messages can arrive,
  228. OVCMD_SAVEIMAGE  which will start the save sequence, and OVCMD_EXPUNGE
  229. which  tells the module the remove itself from memory.  If you receive
  230. an  OVCMD_EXPUNGE  you  should remove yourself from the active list of
  231. saver  modules  using  RemOVSaver() opal.library function, cleanup all
  232. resources and exit.
  233.  
  234. The  third  command  is  OVCMD_PARAMETERS this is used to set specific
  235. parameters  for  your  module,  the  parameters  will be a text string
  236. pointed  to  by lsi_Address.  This is a single text string so that the
  237. parameters  can  be  passed  via ARexx or any other application.  This
  238. would  for  instance  be  called after the following Arexx command was
  239. issued to OpalPaint:
  240.  
  241.     Saver JPEG Quality=75
  242.  
  243. The  string 'Quality=75' would then be passed to the JPEG saver module
  244. via  the  OVCMD_SETPARAMTERS command.  The format of the parameters is
  245. completely  up to your own requirements, you should of course make the
  246. allowable parameters known in the documentation for your module.
  247.  
  248. Once the OVCMD_SAVEIMAGE message has been received you must then reply
  249. to this message and perform the save.
  250.  
  251. The  Flags  in  the  OVCMD_SAVEIMAGE  message defines which components
  252. should  be  saved,  this  could  be  LSIF_IMAGEDATA,  LSIF_STENCIL  or
  253. LSIF_ALPHA,  these  flags  should  effect which data types you request
  254. using OVCMD_GETDATA.
  255.  
  256. To  save the image you first need to find the message port of the Host
  257. application  performing  the  save,  this  port  will  always be named
  258. "OVSaver_Port"  which  is  defined  in the header file as OVSAVERPORT.
  259. Once  this port has been found you can then issue commands back to the
  260. host  so  that  the actual image data can be retrieved.  The following
  261. commands are currently supported:
  262.  
  263.  
  264.    OVCMD_GETDATA
  265.     Get image data from the application. lsi_X, lsi_Y denotes the
  266.     position within the image where you wish to get the image data
  267.     from (i.e. Top-Left), and lsi_Width and lsi_Height defines the
  268.     size of the data that you require. Note that some data formats
  269.     do not support a non-zero x or a width less than the image width.
  270.  
  271.     The actual format of the image data is specified in lsi_SubType
  272.     and can be any of the following formats:
  273.  
  274.        OVDF_PLANAR
  275.         Standard bitplane format. lsi_Planes must contain pointers
  276.         to enough bitplanes to hold the data, the depth of the original
  277.         image is given in lsi_Depth in the OVCMD_SAVEIMAGE message.
  278.         In this format only lsi_Y and lsi_Height are valid, pixel
  279.         positioning of data is not allowed.
  280.  
  281.        OVDF_RGB
  282.         This format will return 3 byte planes of Red, Green and Blue.
  283.         The first 3 entries in lsi_Planes must point to buffers
  284.         large enough to hold lsi_Width*lsi_Height bytes.
  285.  
  286.        OVDF_GREY
  287.         This format will return grey scale image data. Each pixel
  288.         will be returned as a single byte giving 8bit grey scale.
  289.         The first entry in lsi_Planes must point to a buffer large
  290.         enough to hold lsi_Width*lsi_Height bytes.
  291.  
  292.        OVDF_ILBM
  293.         Image data will be returned in interleaved bitmap format.
  294.         The first entry in lsi_Planes must point to a buffer large
  295.         enough to hold ((lsi_Width+15)/16)*lsi_Height*lsi_Depth bytes.
  296.         In this format only lsi_Y and lsi_Height are valid, pixel
  297.         positioning of data is not allowed.
  298.  
  299.        OVDF_ALPHA
  300.         This will return the Alpha channel portion of the image. The
  301.         alpha channel is returned as 8bits per pixel with 1 byte per
  302.         pixel. The Alpha channel has the same dimensions as the image
  303.         itself. The first entry in lsi_Planes must point to a buffer
  304.         large enough to hold lsi_Width*lsi_Height bytes.
  305.  
  306.        OVDF_STENCIL
  307.         Return the stencil data for the image. This function will
  308.         return a single bitplane of data. The first entry of
  309.         lsi_Planes point to a buffer large enough to hold
  310.         ((lsi_Width+15)/16)*lsi_Height bytes.
  311.         In this format only lsi_Y and lsi_Height are valid, pixel
  312.         positioning of data is not allowed.
  313.  
  314.    OVCMD_GETPALETTE
  315.     If the image is a palette mapped image then the palette will be
  316.     copied into the buffer specified by lsi_Address. This will be an
  317.     array of RGB triplets. If the image is not palette mapped then
  318.     lsi_Result will be FALSE. The buffer must be atleast 736 bytes.
  319.  
  320.    OVCMD_GETCLUT
  321.     If the image is 24bit this function will copy the colour
  322.     lookup table for the image into the buffer specified by
  323.     lsi_Address. The colour lookup table contains 256 entries
  324.     of RGB tripletes. This is actually an interleaved format
  325.     of 3 seperate 256 entry lookup tables, one for Red, Green
  326.     and Blue. If the image does not have a CLUT (i.e. is palette
  327.     mapped) then lsi_Result will be FALSE.
  328.  
  329.    OVCMD_GETTHUMBNAIL
  330.     Get the thumbnail data for the image. This will return a pointer
  331.     to a buffer which containing the thumbnail image. The image is
  332.     48x30 in lores OpalVision bitplane format. The total size of this
  333.     image is 12x30x12 or 4320 bytes.
  334.  
  335.    OVCMD_ERROR
  336.     Report to the host application that an error occured during the save.
  337.     If OpalPaint is the host, the error will be reported to the user
  338.     and the save aborted. The allowable error codes are defined in 
  339.     loadsave.h.
  340.  
  341.    OVCMD_DONE
  342.     Report to the host application that the save has completed.
  343.  
  344.  
  345. The  following  command  type  are  host  application  specific, these
  346. commands are available if OpalPaint is the host.  If the host does not
  347. support  these  commands,  the  default  value  as  specified  will be
  348. returned.
  349.  
  350.    OVCMD_USERMESSAGE
  351.     Report a message to the user. lsi_Address should be a pointer to
  352.     a null terminated string. In the case of OpalPaint a requester will
  353.     appear containing the message string and an OK gadget, the command
  354.     will return when the user closes the requester (this also supports
  355.     the '\n' sequence for specifying mulitple lines of text, note that
  356.     in C this must be specified as \\n). If this command is not supported
  357.     it will return immediately.
  358.  
  359.    OVCMD_ASKUSER
  360.     This command will ask the user for a boolean (yes/no or OK/Cancel)
  361.     result. The parameters are the same as OVCMD_USERMESSAGE and the
  362.     returned result will be in lsi_Result. In the case of OpalPaint
  363.     a requester will appear with an OK and CANCEL gadget. If this command
  364.     is not available, TRUE will be returned immediately.
  365.  
  366.    OVCMD_PERCENTAGE
  367.     This command is used to let the host application know the percentage
  368.     of the save that has been performed. OpalPaint will display this
  369.     value in the menu bar to give the user an indication of how things
  370.     are going. lsi_Address should contain a pointer to a _short_ string
  371.     that will appear in the menu bar, this string should be less than
  372.     7 characters. lsi_Result should be a value from 0 to 100 specifying
  373.     the percentage value. If this command is not available it will
  374.     be ignored and returns immediately. It is suggested that you use
  375.     this command as it is very informative to the user.
  376.  
  377.    OVCMD_BUILDREQUEST
  378.     This gives access to OpalPaint's general purpose requester builder
  379.     function. lsi_Address should contain a pointer to a taglist array.
  380.     Using this function you can build your own requesters and get user
  381.     parameters directly, see the documentation on Build_Request() for
  382.     more information. lsi_Result will be TRUE if the user hit OK or
  383.     FALSE if the user hit CANCEL. If this function is not available
  384.     TRUE will be returned immediately.
  385.  
  386.  
  387.  
  388.             LOADER MODULES
  389.  
  390. When  a Loader module initialises itself it must create a message port
  391. which  will  be used to communicate with the host program.  The naming
  392. convention  for  this  port will include a brief name of the format or
  393. purpose  of  the module suffixed with "_Loader" some examples would be
  394. "Tiff_Loader", "FrameGrab_Loader".
  395.  
  396. Once  this  message port has been created you must add yourself to the
  397. current  list  of  active loader modules, to do this you must open the
  398. opal.library and issue the following command:
  399.  
  400.     AddOVLoader (LoaderName,LoaderPort,Flags)
  401.  
  402. 'LoaderName'  will  normally  be  the  portname  without the "_Loader"
  403. suffix.  This name will be used to identify the loader both internally
  404. within  applications  and  also to the user in programs like OpalPaint
  405. which give a list of the currently available loader modules.
  406.  
  407. 'LoaderPort' is a pointer to the message port created earlier.
  408.  
  409. 'Flags' are currently unused.
  410.  
  411. Once  the module has been added to the system, it should then wait for
  412. messages  to  arrive at it's message port.  One of 4 possible messages
  413. can arrive.
  414.  
  415.    OVCMD_FORMATCHECK
  416.     This command is asking your module to check the format of a
  417.     file being loaded, if the format is not known you should
  418.     set lsi_Result to FALSE. If the format is known to the module
  419.     you should return the image details in lsi_Width, lsi_Height,
  420.     lsi_Depth and lsi_Resolution. Also the components of the image
  421.     available should be returned in lsi_Flags, this can be any
  422.     combination of LSIF_HASIMAGE, LSIF_HASSTENCIL and LSIF_ALPHA.
  423.  
  424.     Specifying an image resolution in lsi_Resolution is optional,
  425.     if you have resolution information then fill in this entry
  426.     with the standard opalvision flags (i.e. HIRES24,ILACE24,
  427.     OVERSCAN24), and set the LSIF_RESVALID flags in lsi_Flags.
  428.     If you do not specify a resolution then the host will pick
  429.     an acceptable resolution based on the image size.
  430.  
  431.     To enable you to perform the format identification, the first
  432.     section of the file is contained in a buffer pointed to by
  433.     lsi_Address, the size of this buffer is in lsi_DataLength
  434.     (this is 2K in the current implementation), this is useful
  435.     to check header information. Also lsi_FileName can be used
  436.     to check the file extension (to check for '.gif' for example).
  437.     If this is still not enough, the file can be read directly
  438.     using the supplied file handle.
  439.  
  440.     The OVCMD_FORMATCHECK command is used for the intelligent loader
  441.     in OpalPaint and the library, this way when it attempts to load
  442.     an unknown file it can poll all the available loaders to see if
  443.     any can read the format.
  444.  
  445.     NOTE 1: There are basically 2 types of loaders. The first type
  446.     load images from files and take part in the intelligent loader
  447.     polling sequence, these loaders have the OVLF_NEEDFILENAME
  448.     set (set in the AddOVLoader() call). The second type do not
  449.     require a file name and do not participate in the polling, this
  450.     type does not have the OVLF_NEEDFILENAME flag set. The second
  451.     type is used for a framegraber or scanner of similar type
  452.     device. This type will only receive an OVCMD_FORMATCHECK when
  453.     they are specifically selected by the user, and hence should
  454.     fill in the image size and return TRUE when the
  455.     OVCMD_FORMATCHECK command is received.
  456.  
  457.     NOTE 2: After receiving the OVCMD_FORMATCHECK, you may issue
  458.     an OVCMD_ASKUSER, OVCMD_ERROR, OVCMD_DONE, OVCMD_USERMESSAGE
  459.     or OVCMD_BUILDREQUEST before replying to the OVCMD_FORMATCHECK.
  460.     This allows you to bring up a requester asking for the screen
  461.     size to load, before relaying this information to the host, this
  462.     will be necessary for framegrabber/scanner type modules.
  463.  
  464.  
  465.    OVCMD_LOADIMAGE
  466.     This command tells the loader to perform the load, you will
  467.     recieve this command after you returned TRUE to a OVCMD_FORMATCHECK
  468.     command. Once this is received you should reply to the message and
  469.     perform the load.
  470.  
  471.    OVCMD_SETPARAMETERS
  472.     This command is used to set specific parameters for your
  473.     module, the parameters will be a text string pointed to by
  474.     lsi_Address. This is a single text string so that the parameters
  475.     can be passed via ARexx or any other application. This would for
  476.     instance be called after the following Arexx command was issued
  477.     to OpalPaint:
  478.  
  479.     Loader JPEG Smoothing=On
  480.  
  481.     The  string 'Smoothing=On' would then be passed to the JPEG
  482.     loader module via  the  OVCMD_SETPARAMTERS command to enable
  483.     cross block smoothing. The format of the parameters is completely
  484.     up to your own requirements, you should of course make the
  485.     allowable parameters known in the documentation for your module.
  486.  
  487.    OVCMD_EXPUNGE
  488.     If you receive This command you should remove yourself from the
  489.     active list of loader modules using RemOVLoader() opal.library
  490.     function, cleanup all resources and exit.
  491.  
  492.  
  493.  
  494. To  load the image you first need to find the message port of the Host
  495. application  performing  the  load,  this  port  will  always be named
  496. "OVLoader_Port"  which  is defined in the header file as OVLOADERPORT.
  497. Once  this port has been found you can then issue commands back to the
  498. host  so  that  the  actual  image  data can be sent to the host.  The
  499. following commands are currently supported:
  500.  
  501.  
  502.    OVCMD_SENDDATA
  503.     Send image data to the host application. lsi_X, lsi_Y denotes the
  504.     position within the image where you wish to put the image data
  505.     from (i.e. Top-Left), and lsi_Width and lsi_Height defines the
  506.     size of the data in the supplied buffers. Note that some data formats
  507.     do not support a non-zero x or a width less than the image width.
  508.  
  509.     The actual format of the image data is specified in lsi_SubType
  510.     and can be any of the following formats:
  511.  
  512.        OVDF_PLANAR
  513.         Standard bitplane format. lsi_Planes must contain pointers
  514.         to enough bitplanes to hold the data, the depth of the data
  515.         is given in lsi_Depth. In this format only lsi_Y and 
  516.         lsi_Height are valid, pixel positioning of data is not
  517.         allowed.
  518.  
  519.        OVDF_RGB
  520.         This format is 3 byte planes of Red, Green and Blue.
  521.         The first 3 entries in lsi_Planes must point to buffers
  522.         containing lsi_Width*lsi_Height bytes.
  523.  
  524.        OVDF_GREY
  525.         This format is grey scale image data. Each pixel is defined
  526.         using a single byte per pixel giving 8bit grey scale.
  527.         The first entry in lsi_Planes must point to a buffer
  528.         containing lsi_Width*lsi_Height bytes.
  529.  
  530.        OVDF_ILBM
  531.         This format is interleaved bitmap format. The first entry in
  532.         lsi_Planes must point to a buffer containing
  533.         ((lsi_Width+15)/16)*lsi_Height*lsi_Depth bytes.
  534.         In this format only lsi_Y and lsi_Height are valid, pixel
  535.         positioning of data is not allowed.
  536.  
  537.        OVDF_ALPHA
  538.         This format is the Alpha channel portion of the image. The
  539.         alpha channel is defined as 8bits per pixel with 1 byte per
  540.         pixel. The Alpha channel has the same dimensions as the image
  541.         itself. The first entry in lsi_Planes must point to a buffer
  542.         containing lsi_Width*lsi_Height bytes.
  543.  
  544.        OVDF_STENCIL
  545.         Send the stencil data for the image. This function will
  546.         send a single bitplane of data. The first entry of
  547.         lsi_Planes point to a buffer containing
  548.         ((lsi_Width+15)/16)*lsi_Height bytes.
  549.         In this format only lsi_Y and lsi_Height are valid, pixel
  550.         positioning of data is not allowed.
  551.  
  552.    OVCMD_SETPALETTE
  553.     If the image is a palette mapped image then the palette should
  554.     be sent to the host using this command. lsi_Address should point
  555.     to a buffer holding the palette. This size of the palette should
  556.     be dependent on the depth of the image (i.e. 2^Depth). The format
  557.     of the palette is RGB tripletes. The palette data MUST be sent
  558.     before the image data so that remapping to 24bit can be performed
  559.     if necessary.
  560.  
  561.    OVCMD_SETCLUT
  562.     If the image is 24bit this function can be used to set the
  563.     Colour LookUp Table for the image. A pointer to the CLUT
  564.     data is passed in lsi_Address. The CLUT should contain
  565.     256 entries of RGB tripletes.
  566.  
  567.    OVCMD_ERROR
  568.     Report to the host application that an error occured during the load.
  569.     In OpalPaint is the host, the error will be reported to the user
  570.     and the load aborted. The allowable error codes are defined in 
  571.     loadsave.h.
  572.  
  573.    OVCMD_DONE
  574.     Report to the host application that the load has completed.
  575.  
  576.  
  577. The  following  command  type are host application specific, these commands
  578. are available if OpalPaint is the host.  If the host does not support these
  579. commands, the default value as specified will be returned.
  580.  
  581.  
  582.    OVCMD_USERMESSAGE
  583.     Report a message to the user. lsi_Address should be a pointer to
  584.     a null terminated string. In the case of OpalPaint a requester will
  585.     appear containing the message string and an OK gadget, the command
  586.     will return when the user closes the requester (this also supports
  587.     the '\n' sequence for specifying mulitple lines of text, note that
  588.     in C this must be specified as \\n). If this command is not supported
  589.     it will return immediately.
  590.  
  591.    OVCMD_ASKUSER
  592.     This command will ask the user for a boolean (yes/no or OK/Cancel)
  593.     result. The parameters are the same as OVCMD_USERMESSAGE and the
  594.     returned result will be in lsi_Result. In the case of OpalPaint
  595.     a requester will appear with an OK and CANCEL gadget. If this command
  596.     is not available, TRUE will be returned immediately.
  597.  
  598.    OVCMD_PERCENTAGE
  599.     This command is used to let the host application know the percentage
  600.     of the load that has been performed. OpalPaint will display this
  601.     value in the menu bar to give the user an indication of how things
  602.     are going. lsi_Address should contain a pointer to a _short_ string
  603.     that will appear in the menu bar, this string should be less than
  604.     7 characters. lsi_Result should be a value from 0 to 100 specifying
  605.     the percentage value. If this command is not available it will
  606.     be ignored and returns immediately. It is suggested that you use
  607.     this command as it is very informative to the user.
  608.  
  609.    OVCMD_BUILDREQUEST
  610.     This gives access to OpalPaint's general purpose requester builder
  611.     function. lsi_Address should contain a pointer to a taglist array.
  612.     Using this function you can build your own requesters and get user
  613.     parameters directly, see the documentation on Build_Request() for
  614.     more information. lsi_Result will be TRUE if the user hit OK or
  615.     FALSE if the user hit CANCEL. If this function is not available
  616.     TRUE will be returned immediately.
  617.  
  618.  
  619.  
  620.  
  621.  
  622.                     Martin Boyd, Opal Technology.
  623.  
  624.  
  625.    If you have any questions I am contactable at (in order of preference):
  626.  
  627.    OpalVision BBS +1 310 793 7142  'MartinB'
  628.    Internet:  Martin_David_Boyd@cup.portal.com
  629.    Bix:  mboyd
  630.